class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        for(int i = 0, l = -1; i < nums.size(); ++i)
            if(nums[i] != 0) swap(nums[++l], nums[i]);
    }
};